package com.cskaoyan.mall.controller.admin;

import com.cskaoyan.mall.bean.vo.OrderGoodsStatVO;
import com.cskaoyan.mall.bean.vo.OrderStatVO;
import com.cskaoyan.mall.bean.vo.ResultVO;
import com.cskaoyan.mall.bean.vo.UserStatVO;
import com.cskaoyan.mall.service.OrderService;
import com.cskaoyan.mall.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @name zhangguannan
 * @Date 2021-01-10 16:53
 */
@RestController
@RequestMapping("admin/stat")
public class StatisticalFormController {

    @Autowired
    UserService userService;
    @Autowired
    OrderService orderService;

    @RequestMapping("user")
    public ResultVO userStat(){
        UserStatVO userStat = userService.userStat();
        return ResultVO.ok(userStat);
    }

    @RequestMapping("order")
    public ResultVO orderStat(){
        OrderStatVO orderStatVO = orderService.orderStat();
        return ResultVO.ok(orderStatVO);
    }

    @RequestMapping("goods")
    public ResultVO goodsStat(){
        OrderGoodsStatVO orderGoodsStatVO = orderService.goodsStat();
        return ResultVO.ok(orderGoodsStatVO);
    }



}
